package com.woniuxy.service;

import com.woniuxy.dao.UserMapper;
import com.woniuxy.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.Set;

public class UserServiceImpl implements UserService {
    private UserMapper userMapper;
    public UserServiceImpl() {
        SqlSession sqlSession=MyBatisUtil.crateSqlSession();
        userMapper=sqlSession.getMapper(UserMapper.class);
    }

    @Override
    public String getPwdByUserName(String userName) {
        return userMapper.getPwdByUserName(userName);
    }

    @Override
    public Set<String> getRolesByUserName(String userName) {
        return userMapper.getRolesByUserName(userName);
    }

    @Override
    public Set<String> getPermissionsByUserName(String userName) {
        return userMapper.getPermissionsByUserName(userName);
    }
}
